package com.zhanggm.student.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class Task {
    @Scheduled(fixedDelay = 10000)
    public void task() {
        String name = Thread.currentThread().getName();
        log.info("定时任务:{}",name);
        /*try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/
    }
}
